package com.sailing.xjpb.web.base.bean.configuration;

import com.sailing.xjpb.web.base.bean.processor.DataSourceBeanPostProcessor;
import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 解密相关类config类 用户根据xt.decode.enable来选择启用或者不启用解密功能
 *
 * @author sutao
 * createDate 2022/10/16 17:17
 */
@Configuration
@EnableConfigurationProperties(DecodeConfigProperties.class)
@ConditionalOnProperty(prefix = "xjpb.password.decode", name = "enable", havingValue = "true")
@Data
public class BeanProcessorConfig {

    @Bean
    public DataSourceBeanPostProcessor getDataSourceBeanPostProcessor() {
        return new DataSourceBeanPostProcessor();
    }

}
